package com.xyq.friend.controller.message;

import com.xyq.common.core.controller.BaseController;
import com.xyq.common.core.domain.PageDomain;
import com.xyq.common.core.domain.Result;
import com.xyq.common.core.domain.TableDataInfo;
import com.xyq.friend.aspect.CheckStatus;
import com.xyq.friend.service.message.UserMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user/message")
public class UserMessageController extends BaseController {

    @Autowired
    private UserMessageService userMessageService ;
    @CheckStatus
    @GetMapping("/list")
    public TableDataInfo list(PageDomain pageDomain){
        return  userMessageService.list(pageDomain) ;
    }

    // 删除消息
    @CheckStatus
    @DeleteMapping("/delete")
    public Result delete(Long messageTextId){
        return toResult( userMessageService.delete(messageTextId)) ;
    }

}
